<?
$sql = $db->Query("SELECT time FROM `cron` WHERE `name`='day'");
$update = $db->FetchArray($sql);

if($update['time']+86400 < time()){
	$db->Query("UPDATE `cron` SET `time`='".time()."' WHERE `name`='day'");
	$db->Query("DELETE FROM `visits`");
	$db->Query("DELETE FROM `surfed`");
	$db->Query("DELETE FROM `viewed`");
}
unset($update);
?>
